import pyautogui as p
import pyperclip

coord = p.locateOnScreen("weixin.png") # 获取qq或者微信的坐标
if coord is None:
    print("获取坐标失败，请使用position()获取坐标")
else:
    x,y = p.center(coord)
    p.click(x, y)
    for i in range(20):
        pyperclip.copy("快回我消息")
        p.hotkey("ctrl", "v")
        p.press("enter")
